package blog;

import blog.beans.Post;
import blog.model.PostHelper;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;

/**
 *
 * @author johdah <info@johandahlberg.com>
 */
@ManagedBean
@SessionScoped
public class PostController {
    PostHelper helper;
    
    public PostController() {
        helper = new PostHelper();
    }
    
    public Post getPostById(Integer id) {
        return helper.getPostsById(id);
    }

    public List<Post> getPosts() {
        return helper.getPosts();
    }
    
    public boolean setPost(Post post) {
        return helper.setPost(post);
    }
}